Temporary notebook to get the parameters for the MICE sims for the data ismael sent me.


In [2]:
import pandas as pd
import numpy as np

In [1]:
#fit given by Andres    
#CENTRALS
def f_cen(logmhalo,logmmin,siglogm,fmaxcen,fmincen,k,logmdrop):
    ncen  = 0.5*( 1. + ss.erf((logmhalo[0,:] - logmmin)/siglogm) )
    ncen  = fmaxcen * ncen
    ncen  = ncen * (1.0 - (1.0-fmincen/fmaxcen)/(1.0 + 10**((2.0/k)*(logmhalo[0,:]-logmdrop)))) 
    return log10(ncen)
#SATELLITES
def f_sat(logmhalo,logmmin,siglogm,logm1,alpha): 
    nsat  = 0.5*( 1. + ss.erf((logmhalo[0,:] - logmmin)/siglogm) )
    #nsat  = 0.5*( 1. + ss.erf((logmhalo[0,:] - param_cen[0])/param_cen[1]) )
    nsat  = param_cen[2] * nsat  
    nsat  = nsat * (10**logmhalo[0,:]/10**logm1)**alpha
    return log10(nsat)

mean number of central/satellites per bin. read with pd.read_csv(‘hod_redmagicMICE.csv’, sep=' ’). First columm is the bins in Mhalo, and then columm are n_cen/n_sat + redshift bin + catalog. Where catalog are hd=high density , hl=high luminosity, rl=higher luminosity.


In [3]:
mean_gal_per_bin = pd.read_csv('hod_redmagicMICE.csv', sep=' ')

In [4]:
mean_gal_per_bin


Out[4]:
Unnamed: 0 xbin n_cen_0.075-z-0.175_hd n_sat_0.075-z-0.175_hd n_cen_0.075-z-0.175_hl n_sat_0.075-z-0.175_hl n_cen_0.075-z-0.175_rl n_sat_0.075-z-0.175_rl n_cen_0.175-z-0.275_hd n_sat_0.175-z-0.275_hd ... n_cen_0.775-z-0.875_hd n_sat_0.775-z-0.875_hd n_cen_0.775-z-0.875_hl n_sat_0.775-z-0.875_hl n_cen_0.775-z-0.875_rl n_sat_0.775-z-0.875_rl n_cen_0.875-z-0.975_hl n_sat_0.875-z-0.975_hl n_cen_0.875-z-0.975_rl n_sat_0.875-z-0.975_rl
0 0 10.1 NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1 1 10.4 0.000000e+00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2 2 10.7 0.000000e+00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
3 3 11.0 8.372643e-07 0.000000 0.000000 0.000000 0.000000 0.000000 0.000004 0.000000 ... 0.000000e+00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
4 4 11.3 0.000000e+00 0.000000 0.000000 0.000000 0.000000 0.000000 0.001044 0.000141 ... 0.000000e+00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
5 5 11.6 3.007126e-04 0.000046 0.000000 0.000000 0.000000 0.000000 0.003087 0.001265 ... 0.000000e+00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
6 6 11.9 1.969040e-02 0.005405 0.000096 0.000012 0.000000 0.000000 0.031136 0.011201 ... 3.062637e-07 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
7 7 12.2 5.141302e-02 0.027959 0.008022 0.001968 0.001183 0.000312 0.109684 0.057797 ... 1.342383e-04 0.000039 0.003451 0.000333 0.000023 0.000002 0.000072 0.000002 0.000000 0.000000
8 8 12.5 9.019073e-02 0.071639 0.058483 0.018792 0.014801 0.003710 0.180140 0.145110 ... 2.276298e-04 0.000147 0.060637 0.010363 0.005764 0.000561 0.005749 0.000575 0.000577 0.000057
9 9 12.8 1.358486e-01 0.134447 0.119885 0.055796 0.041039 0.015652 0.240573 0.262414 ... 1.430216e-04 0.000241 0.150890 0.045228 0.054584 0.008078 0.026457 0.005199 0.011907 0.001414
10 10 13.1 1.709455e-01 0.223153 0.166875 0.102223 0.073262 0.028961 0.303412 0.442735 ... 1.078929e-04 0.000378 0.200492 0.093236 0.144193 0.030129 0.040244 0.013605 0.045542 0.007774
11 11 13.4 1.880466e-01 0.373016 0.199708 0.162132 0.106252 0.046647 0.355834 0.763090 ... 6.657878e-05 0.000692 0.225516 0.159962 0.224983 0.063170 0.044235 0.023729 0.086353 0.018575
12 12 13.7 1.985245e-01 0.635815 0.225687 0.267941 0.143863 0.084842 0.410480 1.311108 ... 1.479399e-04 0.001147 0.233671 0.250166 0.279643 0.102633 0.040499 0.034248 0.117020 0.032880
13 13 14.0 2.111853e-01 1.254591 0.260434 0.501669 0.169449 0.145242 0.438935 2.328837 ... 0.000000e+00 0.001499 0.230885 0.398301 0.308096 0.162669 0.030360 0.052599 0.128686 0.050225
14 14 14.3 2.154812e-01 2.255230 0.274059 0.824268 0.205021 0.276151 0.459721 4.522019 ... 0.000000e+00 0.004202 0.226891 0.690276 0.321128 0.225690 0.023409 0.082233 0.148860 0.072029
15 15 14.6 2.288136e-01 4.059322 0.271186 1.576271 0.186441 0.466102 0.433790 8.337900 ... 0.000000e+00 0.004348 0.173913 1.152174 0.243478 0.413043 0.026087 0.095652 0.113043 0.100000
16 16 14.9 2.000000e-01 9.240000 0.280000 2.640000 0.160000 1.160000 0.489796 15.775510 ... 0.000000e+00 0.000000 0.117647 1.705882 0.411765 0.764706 0.000000 0.117647 0.058824 0.176471
17 17 15.2 0.000000e+00 15.333333 0.000000 6.333333 0.000000 2.000000 0.000000 36.000000 ... 0.000000e+00 0.000000 0.500000 2.000000 0.500000 0.500000 0.000000 0.000000 0.000000 0.000000
18 18 15.5 NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

19 rows × 54 columns

parameters for function i sent before. read with pd.read_csv(‘hod_redmagicMICE_fit.csv’, sep=' ’).


In [5]:
hod_fit = pd.read_csv('hod_redmagicMICE_fit.csv', sep=' ')

In [6]:
hod_fit


Out[6]:
ft_bin logmmin_cen_hd siglogm_cen_hd fmaxcen_cen_hd fmincen_cen_hd k_cen_hd logmdrop_cen_hd logmmin_sat_hd siglogm_sat_hd logm1_sat_hd ... logmmin_cen_rl siglogm_cen_rl fmaxcen_cen_rl fmincen_cen_rl k_cen_rl logmdrop_cen_rl logmmin_sat_rl siglogm_sat_rl logm1_sat_rl alpha_sat_rl
0 0.075-z-0.175 13.018649 0.831746 0.212444 0.800000 1.693541 12.465866 12.036011 0.307781 13.080950 ... 13.221106 0.488229 0.172851 0.800000 0.446728 12.730779 12.504646 0.292284 14.029617 0.872154
1 0.175-z-0.275 12.029688 0.311107 0.476371 0.073332 2.191967 12.966289 12.018851 0.290070 13.142377 ... 13.781139 0.843670 0.227788 0.800000 1.032275 13.720632 12.601565 0.736786 13.958900 0.873841
2 0.275-z-0.375 12.091316 0.451114 0.010000 0.144795 0.695210 14.680064 11.952711 0.292076 11.206747 ... 13.167983 0.578004 0.073175 0.800000 2.082144 12.571158 12.580854 0.426130 13.182855 0.689937
3 0.375-z-0.475 12.082363 0.414470 0.010000 0.131122 0.477157 14.572139 12.019664 0.251791 11.324371 ... 12.759979 0.268894 0.010000 0.071626 0.484546 14.631261 12.645472 0.235326 12.671399 0.789382
4 0.475-z-0.575 12.249344 0.584479 0.139899 0.207767 0.370076 14.390770 12.056892 0.248602 12.551026 ... 12.931763 0.296952 0.193410 0.767027 0.073815 12.776305 12.700709 0.251201 13.850202 0.742017
5 0.575-z-0.675 11.987709 0.195099 0.010000 0.110854 0.695338 14.784718 12.109687 0.253232 11.287963 ... 12.765567 0.277001 0.041667 0.150404 0.084717 14.657291 12.685256 0.249301 13.136547 0.760288
6 0.675-z-0.775 12.086976 0.216509 0.011996 0.044249 2.675639 14.130119 12.155971 0.225567 12.058973 ... 12.853057 0.313932 0.040000 0.200961 0.090978 14.666739 12.764845 0.279843 13.056598 0.714394
7 0.775-z-0.875 15.000000 1.298594 0.010091 0.010000 0.120713 15.318451 14.278518 1.660251 15.000000 ... 13.013770 0.287842 0.302326 0.800000 0.056201 12.777814 12.986777 0.354870 14.493610 0.571314
8 0.875-z-0.975 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... 13.165759 0.365044 0.058824 0.125435 0.054657 14.617519 13.037216 0.326586 14.151735 0.608889

9 rows × 31 columns


In [ ]: